package business.exception;

public class BusinessException extends Exception {
	private static final long serialVersionUID = 6677436317168295772L;
	
	public BusinessException (String msg) {
		super(msg);
	}
	
	public BusinessException (String msg, Exception ex) {
		super(msg, ex);
	}
	
	/* partially taken from 
	 * http://download.oracle.com/javase/tutorial/essential/exceptions/chained.html
	 * */
	@Override
	public void printStackTrace() {
		super.printStackTrace();
		StackTraceElement elements[]=getCause().getStackTrace();
		for (StackTraceElement element : elements) {
			 System.out.println(element.getFileName() + ":" 
                     + element.getLineNumber() 
                     + ">> " 
                     + element.getMethodName() + "()");

		}
		getCause().printStackTrace();
	}

}
